#ifndef GAMEHALL_H
#define GAMEHALL_H

#include <QWidget>
#include<QWebSocket>
#include "register.h"
#include "login.h"
#include "gameroom.h"
namespace Ui {
class gameHall;
}

class gameHall : public QWidget
{
    Q_OBJECT

public:
    explicit gameHall(QWidget *parent = nullptr);
    ~gameHall();

    void get_info(QString ssid);//获取用户信息

    void ws_hall(QString ssid);//在大厅建立长连接

    void closeEvent(QCloseEvent *event);//退出页面事件函数

private slots:
    void handle_info();

    void on_pushButton_start_clicked();

    void connectHandle();

    void disConnectHandle();

    //void errorHandle(QAbstractSocket::SocketError error);

    void recvMessageHandle(const QString& msg);

private:
    Ui::gameHall *ui;

    QNetworkAccessManager* manager;
    QNetworkReply* response;
    QString resp;//收到的响应

    QWebSocket* ws;//长连接
    QString _ssid;//用户id
};

#endif // GAMEHALL_H
